'use strict';

var start = function (router) {

    var http = require("http");
    var url = require("url");
    var onRes = function (req, res) {
        var path = url.parse(req.url).href.split('/');
        console.log(req.url, path);
        router(path.shift());
    };
    http.createServer(onRes).listen(8555);
    console.log('Server running at http://127.0.0.1:8555/');
};

module.exports.start = start;